<%@ page contentType="text/html;charset=utf-8" language="java"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> 
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> 
<html:html>
<head>
		<META http-equiv=Content-Type content="text/html; charset=utf-8">
		<LINK href="../styles/sciencee.css"  type=text/css rel=stylesheet>
		<style type="text/css"></style>
		<title>CGProject</title>
		<html:base/>
</head>
<%String CurrentPage = (String)request.getAttribute("CurrentPage");%>
<body>


	<table border="0" width="100%" cellspacing="1" id="table5" height="59" style="border: 1px solid #C0C0C0">
		<tr>
			<td height="25" align="left" bgcolor="#EEF2F7" colspan="2" width="100%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<html:form action="/intoAdd"><html:submit style="font-family: Tahoma; font-size: 11px"><bean:message key="reguser.add"/></html:submit></html:form>
			</td>
		</tr>
		<tr>
			<html:form action="/queryUser" onsubmit="return  submitQueryUser()">
			<td height="25" align="left" width="11%" style="border-right: 1px dotted #C0C0C0; border-bottom: 1px dotted #C0C0C0">
			&nbsp;<html:checkbox property="check1" value="true"/> <bean:message key="reguser.name"/></td>
			<td height="25" align="left" width="88%" style="border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; ">
			&nbsp;<html:text property="regName" size="20" style="border:1px solid #C0C0C0; font-family: Tahoma; font-size: 11px" /></td>
		</tr>
		<tr>
			<td height="25" align="left" width="11%" style="border-right: 1px dotted #C0C0C0; border-bottom: 1px dotted #C0C0C0">
			&nbsp;<html:checkbox property="check2" value="true"/> <bean:message key="reguser.empid"/></td>
			<td height="25" align="left" width="88%" style="border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; ">
			&nbsp;<html:text property="employeeId" size="20" style="border:1px solid #C0C0C0; font-family: Tahoma; font-size: 11px" />
			&nbsp;<input type="button" value="Select Employee" name="B5" style="font-family: Tahoma; font-size: 11px" onclick="openwin('<%=request.getContextPath() %>/regUser/intoQuery.do?Flag=1')"></td>
		</tr>
		<tr>
			<td height="25" align="left" width="11%" style="border-right: 1px dotted #C0C0C0; border-bottom: 1px dotted #C0C0C0">
			&nbsp;<html:checkbox property="check5" value="true"/> <bean:message key="reguser.sortby"/></td>
			<td height="25" align="left" width="88%" style="border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; ">
			&nbsp;<html:select property="sortWay" style="font-family: Tahoma; font-size: 11px">
				<html:option value="regName"><bean:message key="reguser.name"/><bean:message key="reguser.name"/></html:option>
				<html:option value="employee.employeeId" ><bean:message key="reguser.empid"/></html:option>
			</html:select>
			&nbsp;<html:select property="ascORdesc" style="font-family: Tahoma; font-size: 11px">
				<html:option value="ASC"><bean:message key="asc"/></html:option>
				<html:option value="DESC" ><bean:message key="desc"/></html:option>
			</html:select></td>
		</tr>
		<tr>
			<td height="25" align="left" width="107%" style="border-right: 1px dotted #C0C0C0; border-bottom: 1px dotted #C0C0C0" colspan="2">
			<html:submit><bean:message key="query"/></html:submit>
			&nbsp;&nbsp;<html:text property="titlePerPage" size="20" style="border:1px solid #C0C0C0; font-family: Tahoma; font-size: 11px" /><bean:message key="titlepage"/>&nbsp;
			</td>
		</tr>
	</table>
	</html:form>
	<table border="0" width="100%" cellspacing="1" id="table6" height="59" style="border: 1px solid #C0C0C0">
		<tr>
			<td height="25" align="left" bgcolor="#EEF2F7" colspan="3" width="85%">&nbsp;<b></b></td>
		</tr>
		<tr>
			<td height="25" align="left" width="15%" style="border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; ">
			&nbsp;<b><bean:message key="reguser.name"/></b></td>
			<td height="25" align="left" width="26%" style="border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; ">
			<b>&nbsp;<bean:message key="employee"/></b></td>
			<td height="25" align="left" width="29%" style="border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; ">
			&nbsp;<b></b></td>
		</tr>
		<logic:iterate id="element" name="Titles">
		<tr>
			<td height="25" align="left" width="15%" style="border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; ">&nbsp;<b><html:link page="/detail.do" paramId="RegUserId" paramName="element" paramProperty="regUserId"><u><bean:write name="element" property="regName"/></u></html:link></b></td>
			<td height="25" align="left" width="26%" style="border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; ">&nbsp;<bean:write name="element" property="employee.empName"/> (<bean:write name="element" property="employee.employeeId"/>)</td>
			<td height="25" align="left" width="29%" style="border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; ">&nbsp;<html:link page="/intoMod.do" paramId="RegUserId" paramName="element" paramProperty="regUserId">[<bean:message key="modify"/>]&nbsp;&nbsp;</html:link>
			<html:link page="/delUser.do" paramId="RegUserId" paramName="element" paramProperty="regUserId" onclick="return confirm('ConfirmDelete')">[<bean:message key="delete"/>]</html:link></td>
		</tr>
		</logic:iterate>
	</table>
	<table  border="0" width="100%" cellspacing="1" id="table7" height="25">
		<tr>
		<logic:equal name="LastFlag" value="null">
			<font color=#C0C0C0><bean:message key="prepage"/>&nbsp;&nbsp;</font>
		</logic:equal>
		<logic:equal name="LastFlag" value="notNull">
			<html:link page="/index.do" name="LastPage"><font color=#990000><bean:message key="prepage"/>&nbsp;&nbsp;</font></html:link>
		</logic:equal>
		<bean:message key="page"/>
		<logic:iterate id="element" name="Paras">
		<logic:equal name="element" property="string" value="<%=CurrentPage%>">
			<font color="#FF0000">&nbsp;&nbsp;<bean:write name="element" property="string"/></font>
		</logic:equal>
		<logic:notEqual name="element" property="string" value="<%=CurrentPage%>">
			&nbsp;&nbsp;<html:link page="/index.do" name="element" property="map"><font color=#808080><bean:write name="element" property="string"/></font></html:link>
		</logic:notEqual>
		</logic:iterate>
		&nbsp;&nbsp;.
		<logic:equal name="NextFlag" value="null">
			<font color=#C0C0C0>&nbsp;&nbsp;<bean:message key="nextpage"/></font>
		</logic:equal>
		<logic:equal name="NextFlag" value="notNull">
			<html:link page="/index.do" name="NextPage"><font color=#990000>&nbsp;&nbsp;<bean:message key="prepage"/></font></html:link>
		</logic:equal>
		</tr>
	</table>
</body>
</html:html>
<script language="javascript">
function openwin(url)
{
	window.open(url,'newwindow','width=400,height=200');
}
function isEmpty(theField)
	{
		if(theField.value=="")
			return true;
		else
		return false;
	}

function submitQueryUser()
{
	var emptyField=0;
	if(queryUserForm.check1.checked==true)
	{
	 	if(isEmpty(window.document.queryUserForm.regName)==true)
 		{
     		alert("Please input regname！");
     		window.document.queryUserForm.regName.focus();
     		return false;
 		}
	}
	if(queryUserForm.check2.checked==true)
	{
	 	if(isEmpty(window.document.queryUserForm.empNo)==true)
 		{
     		alert("please select a employee！");
     		window.document.queryUserForm.empNo.focus();
     		return false;
 		}
	}
	if(queryUserForm.check3.checked==true)
	{
	 	if(isEmpty(window.document.queryUserForm.email)==true)
 		{
     		alert("Please input the email");
     		window.document.queryUserForm.email.focus();
     		return false;
 		}
	}
	if(isEmpty(window.document.queryUserForm.titlePerPage)==true)
 		{
     		alert("Please input the number of titleperpage");
     		window.document.queryUserForm.titlePerPage.focus();
     		return false;
 		}


 	window.document.queryUserForm.submit();
 }

</script>



		

				


